<?php


$str = '<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div style="width:100px; height:100px; background-color:red"></div>
</body>
<?php echo 12;?>
</html>';

$zx = '/\<\?php.*?\?\>/';

preg_match_all($zx, $str, $result);

echo "<pre>";
print_r($result);
echo "</pre>";
echo PHP_EOL;


$old = $result;

$new = [];
foreach ($result as $value) {

}

exec('php <?php echo 12;?>', $a);
echo "<pre>";
print_r($a);
echo "</pre>";
echo PHP_EOL;
